﻿
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Saury.MCPServer.Tools;
//CreateEmptyApplicationBuilder创建一个最小化的应用程序构建器，它不包含任何默认配置
Console.WriteLine("Starting MCP Server...");
var builder = Host.CreateEmptyApplicationBuilder(settings: null);
builder.Services
    .AddMcpServer()
    .WithStdioServerTransport()//标准IO传输方式
    .WithToolsFromAssembly();//扫描程序集中添加了McpServerTool特性的方法注册为工具
                             // .WithTools<EchoTool>()//单个添加
await builder.Build().RunAsync();
